package com.first.teacher.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.first.common.pojo.EduTeacher;
import com.first.teacher.mapper.CheckTeacherMapper;
import com.first.teacher.service.CheckTeacherService;
import com.first.teacher.vo.TeacherVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: first-project
 * @description:
 * @author: 马英贤
 * @create: 2023-05-27 21:53
 **/
@Service
public class CheckTeacherServiceImpl implements CheckTeacherService {
    @Resource
    private CheckTeacherMapper checkTeacherMapper;

    @Override
    public Page<EduTeacher> selectAll(Integer current, Integer pageSize, TeacherVo teacherVo) {
        Page<EduTeacher> teacherPage = new Page<>();
        QueryWrapper<EduTeacher> wrapper1 = new QueryWrapper<>();
        if (teacherVo.getName() != null){
            wrapper1.like("name",teacherVo.getName());
        }
        if (teacherVo.getMobile() != null){
            wrapper1.like("mobile",teacherVo.getMobile());
        }
        if (teacherVo.getCheckStatus() != null){
            wrapper1.eq("check_status",teacherVo.getCheckStatus());
        }
        wrapper1.eq("check_status",2);
        Page<EduTeacher> select = checkTeacherMapper.select(teacherPage, wrapper1);
        return select;
    }


}
